package com.td.core.communication.obj;

import com.td.core.communication.Sendable;

public class Message implements Sendable<Message> {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int number;
	private String value;
	
	public static final int TIME_LEFT = 10;
	public static final int PLAYER_QUEUE = 11;
	public static final int START_GAME = 12;
	
	public static final int PRE_GAME_INFO_REQUEST = 21;
	
	public static final int EXIT = 600; 
	
	public Message(int num, String val) {
		number = num;
		value = val;
	}
	
	public Message(int num, int val) {
		number = num;
		value = new Integer(val).toString();
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public void copyTo(Message obj) {
		obj.number = this.number;
		if(this.value != null)
			obj.value = new String(this.value);
	}

	@Override
	public Message getCopy() {
		return new Message(this.number, this.value);
	}	
}
